#include <QtGui>
#include <QTreeWidget>
#include <QTreeWidgetItem>

#include "mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
	:QMainWindow(parent)
{
    ui.setupUi(this);
	sonMainWindow = NULL;
	setCentralWidget(ui.mdiArea);
	setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
}

MainWindow::~MainWindow()
{

}

void MainWindow::on_actionAbout_triggered()
{
//	CxDlgNewHorizon new_dialog(this);
// 	if (new_dialog.exec())
// 	{
// 		QString text = new_dialog.getName();
// 		if (text == "lizhi")
// 		{
// 			QMessageBox::warning(this,QString(tr("warning")),QString(tr("Please input a new name.")),QMessageBox::Ok);
// 			return ;
// 		}
// 	}
}

void MainWindow::on_actionUndo_triggered()
{
		sonMainWindow = new CxDlgNewHorizon(this);
		addWindow(sonMainWindow);
		sonMainWindow->show();
}

void MainWindow::addWindow( QWidget *window )
{
	ui.mdiArea->addSubWindow(window);
}

void MainWindow::on_treeWidget_itemDoubleClicked( QTreeWidgetItem * item, int column )
{
	emit itemDoubleClicked (item, column);
}
